package org.carl.nginx.main;

import cn.hutool.core.io.file.Tailer;
import cn.hutool.core.lang.Console;
import org.carl.nginx.core.NginxConfig;

import java.io.File;

public class TailMain {
    public static void main(String[] args) {
        String nginxHome = NginxConfig.getNginxHome();
        String tailLog = NginxConfig.getTailLog();
        File file = new File(nginxHome + File.separator + tailLog);
        if(!file.exists()){
            Console.log("file "+file.toString()+" not exists!");
        }
        Console.log("start tail service at "+file.toString());
        Tailer tailer=new Tailer(file, Tailer.CONSOLE_HANDLER,0);
        tailer.start();
    }
}
